package com.youkeyi.ddy.cloud.common.api.application.system.position;

import com.youkeyi.ddy.cloud.common.api.application.system.position.dto.SystemPositionDetailCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.position.dto.SystemPositionListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.position.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统岗位
 *
 * @Positionor liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】position management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemPositionCloudServiceFallback.class)
@RequestMapping("/system/position")
public interface SystemPositionCloudService {

    // 查询岗位列表
    @ApiOperation(value = "Query System Position List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemPositionListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Position List", dataType = "SystemPositionListCloudParam", dataTypeClass = SystemPositionListCloudParam.class),
    })
    @GetMapping
    public abstract SystemPositionListCloudDto list(SystemPositionListCloudParam param);

    // 查询岗位列表
    @ApiOperation(value = "Query Position Simple List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.simpleList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemPositionListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Position List", dataType = "SystemPositionListCloudParam", dataTypeClass = SystemPositionListCloudParam.class),
    })
    @GetMapping("/simple")
    public abstract SystemPositionListCloudDto simpleList(SystemPositionListCloudParam param);

    // 查询岗位详情
    @ApiOperation(value = "Query System Position Detail", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.detail")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemPositionDetailCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "positionPrimaryKey", paramType = "path", value = "Param of Query System Position Detail", dataType = "String", dataTypeClass = String.class),
    })
    @GetMapping("/{positionPrimaryKey}")
    public abstract SystemPositionDetailCloudDto detail(@PathVariable("positionPrimaryKey") String positionPrimaryKey);

    // 创建岗位
    @ApiOperation(value = "Create System Position", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Position", dataType = "SystemPositionCreateCloudParam", dataTypeClass = SystemPositionCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemPositionCreateCloudParam param);


    // 编辑岗位
    @ApiOperation(value = "Update System Position", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Position", dataType = "SystemPositionUpdateCloudParam", dataTypeClass = SystemPositionUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemPositionUpdateCloudParam param);


    // 删除岗位
    @ApiOperation(value = "Delete System Position", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.position.SystemPositionCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Position", dataType = "SystemPositionDeleteCloudParam", dataTypeClass = SystemPositionDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemPositionDeleteCloudParam param);

}
